package com.binest.invitationFriend.service.impl;

import java.util.List;
import com.binest.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.binest.invitationFriend.mapper.InvitationFriendMapper;
import com.binest.invitationFriend.domain.InvitationFriend;
import com.binest.invitationFriend.service.IInvitationFriendService;

/**
 * 邀请好友Service业务层处理
 * 
 * @author wwd
 * @date 2024-02-05
 */
@Service
public class InvitationFriendServiceImpl implements IInvitationFriendService 
{
    @Autowired
    private InvitationFriendMapper invitationFriendMapper;

    /**
     * 查询邀请好友
     * 
     * @param id 邀请好友主键
     * @return 邀请好友
     */
    @Override
    public InvitationFriend selectInvitationFriendById(String id)
    {
        return invitationFriendMapper.selectInvitationFriendById(id);
    }

    /**
     * 查询邀请好友列表
     * 
     * @param invitationFriend 邀请好友
     * @return 邀请好友
     */
    @Override
    public List<InvitationFriend> selectInvitationFriendList(InvitationFriend invitationFriend)
    {
        return invitationFriendMapper.selectInvitationFriendList(invitationFriend);
    }

    /**
     * 新增邀请好友
     * 
     * @param invitationFriend 邀请好友
     * @return 结果
     */
    @Override
    public int insertInvitationFriend(InvitationFriend invitationFriend)
    {
        invitationFriend.setCreateTime(DateUtils.getNowDate());
        return invitationFriendMapper.insertInvitationFriend(invitationFriend);
    }

    /**
     * 修改邀请好友
     * 
     * @param invitationFriend 邀请好友
     * @return 结果
     */
    @Override
    public int updateInvitationFriend(InvitationFriend invitationFriend)
    {
        invitationFriend.setUpdateTime(DateUtils.getNowDate());
        return invitationFriendMapper.updateInvitationFriend(invitationFriend);
    }

    /**
     * 批量删除邀请好友
     * 
     * @param ids 需要删除的邀请好友主键
     * @return 结果
     */
    @Override
    public int deleteInvitationFriendByIds(String[] ids)
    {
        return invitationFriendMapper.deleteInvitationFriendByIds(ids);
    }

    /**
     * 删除邀请好友信息
     * 
     * @param id 邀请好友主键
     * @return 结果
     */
    @Override
    public int deleteInvitationFriendById(String id)
    {
        return invitationFriendMapper.deleteInvitationFriendById(id);
    }
}
